package com.chenyuxin.ilp.util;

import com.chenyuxin.ilp.model.vo.user.UserLoginVo;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtil {
    public static String getUserId(){
        UserLoginVo userLoginVo = (UserLoginVo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return userLoginVo.getId();
    }
    public static UserLoginVo getUserInformation(){
        return (UserLoginVo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
